%%%%%%%%%%%%%%%%%%%%%%preface.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sample preface
%
% Use this file as a template for your own input.
%
%%%%%%%%%%%%%%%%%%%%%%%% Springer %%%%%%%%%%%%%%%%%%%%%%%%%%
\preface
%% Please write your preface here
The first electronic computers appeared in the 1940's and were programmed in machine language by sequences of 0's and 1's that explicitly told the computer what operations to execute and in what order. The operations themselves were very low level: move data from one location to another, add the contents of two registers, compare two values, and so on. Needless to say, this kind of programming was slow, tedious, and error prone. And once written, the programs were hard to understand and modify.

The first step towards more people-friendly programming languages was the development of mnemonic assembly languages in the early 1950's. Initially, the instructions in an assembly language were just mnemonic representations of machine instructions. Later, macro instructions were added to assembly languages so that a programmer could define parameterized shorthands for frequently used sequences of machine instructions. 

A major step towards higher-level languages was made in the latter half of the 1950's with the development of Fortran for scientific computation, Cobol for business data processing, and Lisp for symbolic computation. The philosophy behind these languages was to create higher-level notations with which programmers could more easily write numerical computations, business applications, and symbolic programs. These languages were so successful that they are still in use today. In the following decades, many more languages were created with innovative features to help make programming easier, more natural, and more robust.

Since the design of programming languages and compilers are intimately related, the advances in programming languages placed new demands on compiler writers. They had to devise algorithms and representations to translate and support the new language features. Since the 1940's, computer architecture has evolved as well. Not only did the compiler writers have to track new language features, they also had to devise translation algorithms that would take maximal advantage of the new hardware capabilities.
Compilers can help promote the use of high-level languages by minimizing the execution overhead of the programs written in these languages. Compilers are also critical in making high-performance computer architectures effective on users' applications. In fact, the performance of a computer system is so dependent on compiler technology that compilers are used as a tool in evaluating architectural concepts before a computer is built.

Compiler writing is challenging. A compiler by itself is a large program. Moreover, many modern language-processing systems handle several source languages and target machines within the same framework; that is, they serve as collections of compilers, possibly consisting of millions of lines of code. Consequently, good software engineering techniques are essential for creating and evolving modern language processors.

A compiler must translate correctly the potentially infinite set of programs that could be written in the source language. The problem of generating the optimal target code from a source program is undecidable in general; thus, compiler writers must evaluate trade-offs about what problems to tackle and what heuristics to use to approach the problem of generating efficient code.

Compiler design is full of beautiful examples where complicated real-world problems are solved by abstracting the essence of the problem mathematically. These serve as excellent illustrations of how abstractions can be used to solve problems: take a problem, formulate a mathematical abstraction that captures the key characteristics, and solve it using mathematical techniques. The problem formulation must be grounded in a solid understanding of the characteristics of computer programs, and the solution must be validated and refined empirically.

A compiler must accept all source programs that conform to the specification of the language; the set of source programs is infinite and any program can be very large, consisting of possibly millions of lines of code. Any transformation performed by the compiler while translating a source program must preserve the meaning of the program being compiled. Compiler writers thus have influence over not just the compilers they create, but all the programs that their compilers compile. This leverage makes writing compilers particularly rewarding; however, it also makes compiler development challenging.

In fall of 2011, I took the CS440 in George Mason University. The Class is mainly about Compilers techniques. Prof. Nordstrom, one of my favourite professors in Mason, teaches this class. I enjoyed the class so much; also I had put significant effort into this class along with its assignments. Bifei Chen, my co-worker also very interesting in this topic. So I came up with the idea of writing a book for the class. I want to put my whole experience of the class into the book. For example, the text book knowledge, thoughts in the class, source code, etc. Paxi is the name of the language for which we wrote the compiler; also it's the name of the book. 


There are total 6 chapters in the book:
\begin{itemize}
\item Chapter 1 will talk about the books and tools will be used, and some other juicy resources;
\item Chapter 2 will talk about the PVM, ie. the PAXI emulator;
\item Chapter 3 will talk about the compiler structures; 
\item Chapter 4 will talk about the lexical analyser and the use of flex;
\item Chapter 5 will talk about the Symbol Table;
\item Chapter 6 will talk about the Syntax analyser and the use of Bison, along with code generation.
\end{itemize}
And, appendix:
\begin{itemize}
\item PVM instructuions set;
\item PAXI reserved words and introduction;
\item BNF for PAXI;
\item Complete code of the PAXI compiler.
\end{itemize}
And, more:
\begin{itemize}
\item Lex file for Pascal;
\item Pascal grammar in yacc file.
\end{itemize}
And, every book should have:
\begin{itemize}
\item ASCII table.
\end{itemize}
You can find all the related information at \url{http://mason.gmu.edu/~pliu4}
\newline
\\ Enjoy.
\newline
\vspace{\baselineskip}
\begin{flushright}\noindent
Fairfax, November 2011\hfill {\it Pei  Liu}\\
\end{flushright}